import { createRouter, createWebHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/home.vue'),
    meta: { title: "首页", show: true, icon: "HomeFilled" }
  },
  {
    path: '/product',
    component: () => import("@/views/product/index.vue"),
    meta: { title: "商品管理", show: true, icon: "Tickets" },
    children: [
      {
        path: '/product/add',
        name: 'product-add',
        component: () => import("@/views/product/Add.vue"),
        meta: { title: "商品添加", show: true, icon: "Plus" }
      },
      {
        path: '/product/edit',
        name: 'product-edit',
        component: () => import("@/views/product/Edit.vue"),
        meta: { title: "商品修改", show: true, icon: "Refresh" }
      },
      {
        path: '/product/list',
        name: 'product-list',
        component: () => import("@/views/product/List.vue"),
        meta: { title: "商品列表", show: true, icon: "List" }
      }
    ]
  }
 
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
